const state = {
  tabList: [],
  isCollapse: false
}
const getters = {

}
const mutations = {
  ADDITEM (state, value) {
    state.tabList.push(value)
  },
  REMOVEITEM (state, value) {
    state.tabList = state.tabList.filter((tab) => tab.path !== value)
  },
  CHANGECOLLAPSE (state, value) {
    state.isCollapse = !state.isCollapse
  }
}
const actions = {
  removeItem (context, value) {
    context.commit('REMOVEITEM', value)
  },
  addItem (context, value) {
    context.commit('ADDITEM', value)
  },
  changeCollapse (context, value) {
    context.commit('CHANGECOLLAPSE', value)
  }
}
export default {
  namespaced: 'menu',
  state,
  getters,
  mutations,
  actions
}
